cmake_minimum_required(VERSION 3.0.2)
project(vnav_assistant)

set(CMAKE_CXX_FLAGS "-std=c++11 -O3 -Wall")

find_package(catkin REQUIRED COMPONENTS
  cv_bridge
  geometry_msgs
  nav_msgs
  roscpp
  rospy
  sensor_msgs
  std_msgs
  tf
)

find_package(OpenCV 3.4.7 REQUIRED)

catkin_package(
#  INCLUDE_DIRS include
#  LIBRARIES track_assistant
#  CATKIN_DEPENDS cv_bridge geometry_msgs nav_msgs roscpp rospy sensor_msgs std_msgs tf
#  DEPENDS system_lib
)

include_directories(
# include
  ${catkin_INCLUDE_DIRS}
)

include_directories(
        ${PROJECT_SOURCE_DIR}/include/VNav_Assistant
        ${PROJECT_SOURCE_DIR}/include
        ${OpenCV_INCLUDE_DIRS}
        "/usr/local/include/eigen3"
)

add_library(${PROJECT_NAME} SHARED
        src/tf_publisher.cpp
        src/Converter.cpp
        src/visual_frames_system.cpp
        src/TagItems.cpp
        )

set(THIRD_PARTY
        ${OpenCV_LIBS})

set(APRIL_TAG_LIBS
        ${PROJECT_SOURCE_DIR}/ThirdParty/apriltag/lib/libapriltag.so.3.1.0)

target_link_libraries(${PROJECT_NAME} ${THIRD_PARTY} ${catkin_LIBRARIES})

#Nodes
add_executable(fixed_tf_frames_node src/fixed_tf_frames_node.cpp)
target_link_libraries(fixed_tf_frames_node
        ${catkin_LIBRARIES} ${THIRD_PARTY} ${PROJECT_NAME})

add_executable(visual_tf_node src/visual_frames_helper_node.cpp)
target_link_libraries(visual_tf_node
        ${catkin_LIBRARIES} ${THIRD_PARTY} ${PROJECT_NAME})

add_executable(tag_check src/tag_check.cpp)
target_link_libraries(tag_check
        ${catkin_LIBRARIES} ${THIRD_PARTY} ${PROJECT_NAME})